// 用户登录请求参数模型
import {UnpackedMessage} from "@/utils/packer.ts";

export interface RegisterRequestModel {
    avatar: string | Blob,
    nickname: string;
    gender: string;
    realname: string;
    mobile: string;
    identity: string;
    email: string;
    password: string;
    confirm: string;
    captcha: string;
    agree: boolean;
}

export interface PasswordRequestModel {
    email: string;
    password: string;
    confirm: string;
    captcha: string;
}

export interface AuthRequestModel {
    type?: string;
    email?: string;
    password?: string;
    key?: string;
    captcha: string;
}

//Auth返回数据模型，返回token和用户信息
export interface AuthModel {
    token: string;
    user: UserInfoModel;
}

/**
 * 用户模型
 */
export interface UserInfoModel {
    id: string;
    nickname: string | null;
    avatar: string | null | Blob;
    email: string;
    realname: string | null;
    mobile: string | null;
    identity: string | null;
    gender: string;
    description: string | null;
    state: string;
    created_at: string;
    roles?: string[];
    roleNames?: string[];
}


/**
 * 动态路由和权限模型
 */
export interface MenuPermissionsModel {
    menus: Menu.MenuOptions[];
    permissions: string[];
}

/**
 * 任务模型
 */
export interface TaskModel {
    id: string;
    taskName: string;
    type: string;
    result: string;
    state: string;
    stateName: string;
    createDate: string;
}

/**
 * 消息模型
 */
export interface MessageModel {
    id: number;
    uuid: string;
    receiver: string | number;
    pushed: number;
    read: string | null;
    created_at: string;
    websocket_message: UnpackedMessage[];
}
